<extend name="Public:base" />
<block name="content">
    <script>
        function check(){
            var work_name= $('input[name=work_name]').val();
            var desc = $('input[name=desc]').val();
            var sort = $('input[name=sort]').val();
            var standard = $('input[name=standard]').val();
            var honour = $('input[name=honour]').val();
            var select = $("select").val();

            if($.trim(work_name) ==''){
                alert('名称不能为空！');
                return false;
            }
            if($.trim(sort)==''){
                alert('排序不能为空！');
                return false;
            }
            if(isNaN(sort) || isNaN(standard) || isNaN(honour)){
                alert('请输入数字！')
                return false;
            }
            if($.trim(standard)==''){
                alert('参考价不能为空！');
                return false;
            }
            if($.trim(honour)==''){
                alert('参考价不能为空！');
                return false;
            }
            if(select=='请选择类型'){
                alert('请选择一个分类！');
                return false;
            }

        }
    </script>
    <div class="page-header">
        <div class="row">
            <volist name="work" id="vo">
            <div class="col-xs-12">
                <form class="form-horizontal"  id="validation-form" method="post" onsubmit="return check()" action='{:U("Renovation/editworkcontent")}'>
                    <div class="form-group required">
                        <label class="col-sm-2 control-label">工作内容名称：</label>
                        <div class="col-sm-10">
                            <input  class="form-control"  style="width:220px;"  type="text" placeholder="" name="work_name"  value="{$vo.name}" />
                        </div>
                    </div>
                    <input type="hidden" name="id" value="{$vo.work_id}"/>
                    <div class="form-group required">
                        <label class="col-sm-2 control-label">说明：</label>
                        <div class="col-sm-10">
                            <input  class="form-control" style="width:220px;" type="text" placeholder="" name="desc"  value="{$vo.desc}" />
                        </div>
                    </div>
                    <div class="form-group required">
                        <label class="col-sm-2 control-label">排序：</label>
                        <div class="col-sm-10">
                            <input  class="form-control" style="width:220px;" type="text" placeholder="" name="sort" value="{$vo.order}"/>
                        </div>
                    </div>
                    <div class="form-group required">
                        <label class="col-sm-2 control-label">状态：</label>
                        <label><input type="radio"  name="status" value="1" onclick="" checked="checked"/>开启</label>&nbsp;&nbsp;&nbsp;&nbsp;
                        <label><input type="radio" name="status" value="2" onclick="" />关闭</label>
                    </div>
                    <div class="form-group required">
                        <label class="col-sm-2 control-label">分类：</label>
                        <div class="col-sm-10">
                            <select name="type">
                                <option>请选择类型</option>
                                <volist name="select" id="v">
                                    <php>if($vo['parent_id']==$v['occ_id']){</php>
                                    <option value="{$v.occ_id}" selected="selected">{$v.name}</option>
                                    <php>}else{</php>
                                    <option value="{$v.occ_id}">{$v.name}</option>
                                    <php>}</php>
                                </volist>
                            </select>
                        </div>
                    </div>
                    <div class="form-group required">
                        <label class="col-sm-2 control-label">标准参考价：</label>
                        <div class="col-sm-10">
                            <input  class="form-control" style="width:220px;" type="text" placeholder="" name="standard" value="{$vo.standard_rp}"/>
                        </div>
                    </div>
                    <div class="form-group required">
                        <label class="col-sm-2 control-label">贵宾参考价：</label>
                        <div class="col-sm-10">
                            <input  class="form-control" style="width:220px;" type="text" placeholder="" name="honour" value="{$vo.honour_rp}"/>
                        </div>
                    </div>
            </volist>
                    <div class="form-group">
                        <label class="col-sm-1 control-label no-padding-left"> </label>
                        <div class="col-sm-11">
                            <input type="submit" value="提交" class="btn btn-primary" />
                        </div>
                    </div>
                </form>
            </div>
        </div>
</block>

